package model

import (
	_"github.com/go-sql-driver/mysql"
	"log"
	"github.com/go-xorm/xorm"
)

var engine *xorm.Engine

func init() {
	var err error
	engine, err = xorm.NewEngine("mysql", "root:root@/tea-fermentation?charset=utf8")
	if err != nil {
		log.Fatal("fail to create xorm engine! error: %v\n", err)
	}
	engine.ShowSQL(true)
	engine.SetMaxIdleConns(20)
	engine.SetMaxOpenConns(20)
}
